package services

import (
	"context"
	"wxapi/internal/svc"
	"wxapi/models"
)

func GetIndexActivity(ctx context.Context, svc *svc.ServiceContext) (*models.Activity, error) {
	activity := &models.Activity{}

	svc.Mysql.Model(&models.Activity{}).Select("id, activity_name, activity_avatar").Where("state = 100 AND show_index = 1").Order("`order`").First(&activity)

	return activity, nil
}
